<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>情侣调情飞行棋 - Lovers Flirt Aero v2</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            background: linear-gradient(to bottom, #ffebee, #ffc1e3);
            color: #333;
            text-align: center;
            margin: 0;
            padding: 20px;
        }
        #board {
            display: inline-block;
            margin: 20px auto;
            border: 3px solid #ccc;
            border-radius: 10px;
            background: #fff;
            padding: 10px;
            max-width: 100%;
        }
        .track {
            display: flex;
            justify-content: space-around;
            align-items: center;
            flex-wrap: wrap;
            width: 100%;
            max-width: 800px;
            height: auto;
            background: #f0f0f0;
            border-radius: 5px;
            margin: 10px 0;
            padding: 5px;
        }
        .cell {
            width: 25px;
            height: 25px;
            border: 1px solid #ccc;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 10px;
            position: relative;
            color: #333;
            margin: 2px;
        }
        .start { background: #ffc1e3; }
        .end { background: #ff69b4; }
        .piece {
            width: 15px;
            height: 15px;
            border-radius: 50%;
            position: absolute;
            z-index: 10;
            transition: all 0.5s ease;
            font-size: 10px;
        }
        .player1 { background: #ff69b4; color: #fff; } /* 粉红 - 女方 */
        .player2 { background: #4169e1; color: #fff; } /* 蓝 - 男方 */
        #dice {
            font-size: 36px;
            margin: 10px;
            cursor: pointer;
            user-select: none;
        }
        #dice:hover { transform: scale(1.1); }
        button {
            background: #ff69b4;
            color: #fff;
            border: none;
            padding: 8px 16px;
            margin: 5px;
            border-radius: 5px;
            cursor: pointer;
            font-size: 14px;
        }
        button:hover { background: #ff1493; }
        #status {
            font-size: 16px;
            margin: 10px;
            color: #333;
        }
        #task {
            font-size: 18px;
            margin: 20px;
            padding: 15px;
            background: rgba(255, 255, 255, 0.8);
            border-radius: 10px;
            color: #ff69b4;
            font-weight: bold;
        }
        #sweet-bonus {
            color: #ff69b4;
            font-weight: bold;
        }
        /* 手机适配 */
        @media (max-width: 600px) {
            .track {
                flex-direction: column;
                height: auto;
            }
            .cell {
                width: 20px;
                height: 20px;
                font-size: 8px;
            }
            .piece {
                width: 12px;
                height: 12px;
                font-size: 8px;
            }
            #dice {
                font-size: 48px;
            }
            button {
                padding: 10px 20px;
                font-size: 16px;
            }
        }
    </style>
</head>
<body>
    <h1>❤️💙 情侣调情飞行棋 ❤️💙</h1>
    <p>做爱前的前戏游戏！每步触发调情任务，从浪漫到露骨，享受渐进刺激～</p>
    
    <div id="board">
        <div class="track" id="track">
            <!-- 棋盘格子将动态生成 -->
        </div>
        <div>
            <span id="dice">🎲</span>
            <button id="nextPlayerBtn">下一个玩家</button>
            <button id="resetBtn">重置游戏</button>
        </div>
        <div id="status">当前玩家：玩家1 (❤️)</div>
        <div id="sweet-bonus">甜蜜加成：0</div>
    </div>
    <div id="task">任务区：掷骰子后显示调情任务！</div>

    <script>
        document.addEventListener('DOMContentLoaded', function() {
            try {
                initBoard();
                console.log('游戏初始化成功');
            } catch (error) {
                console.error('初始化错误:', error);
            }
        });

        // 游戏状态
        let currentPlayer = 1; // 1: 玩家1 (女方 ❤️), 2: 玩家2 (男方 💙)
        let diceValue = 0;
        let pieces = {
            1: [0, 0, 0, 0], // 玩家1的4个棋子位置
            2: [0, 0, 0, 0]  // 玩家2的4个棋子位置
        };
        let sweetBonus = 0; // 甜蜜加成（影响步数和任务强度）
        let flyingCount = {1: 0, 2: 0}; // 已起飞棋子数
        const totalCells = 50; // 缩短为50格，便于手机
        const colors = {1: '❤️', 2: '💙'};

        // 调情任务池（分级别，渐进色情）
        const tasks = {
            low: [  // 轻度：浪漫调情
                "轻轻亲吻对方的嘴唇，持续5秒，感受心跳加速。",
                "拥抱对方，耳语一句情话，如'我爱你到骨子里'。",
                "用手指轻轻划过对方的手臂，制造酥麻感。",
                "盯着对方的眼睛，说出你最喜欢的身体部位。",
                "轻轻咬一口对方的耳垂，吹气调情。"
            ],
            medium: [  // 中度：亲密触摸、脱衣
                "用手抚摸对方的胸部或臀部，慢慢揉捏。",
                "脱掉对方的一件衣服，露出肌肤亲吻。",
                "用舌头舔舐对方的脖子，留下湿痕。",
                "按摩对方的私密部位，通过衣服轻轻刺激。",
                "让对方坐在你腿上，磨蹭身体增加摩擦。"
            ],
            high: [  // 高度：露骨性行为
                "用嘴含住对方的乳头或阴茎，轻轻吮吸。",
                "手指插入对方的阴道或肛门，缓慢抽动。",
                "脱光衣服，互相自慰看着对方高潮。",
                "进行口交，让对方在嘴里射精或喷水。",
                "模拟性交姿势，干磨直到一方忍不住。"
            ]
        };

        // 初始化棋盘
        function initBoard() {
            const track = document.getElementById('track');
            track.innerHTML = '';
            for (let i = 0; i <= totalCells; i++) {
                const cell = document.createElement('div');
                cell.className = 'cell';
                cell.id = `cell-${i}`;
                cell.textContent = i === 0 ? '起' : (i === totalCells ? '终' : '');
                if (i === 0) cell.classList.add('start');
                if (i === totalCells) cell.classList.add('end');
                track.appendChild(cell);
            }
            updateBoard();
        }

        // 更新棋盘显示
        function updateBoard() {
            for (let i = 0; i <= totalCells; i++) {
                const cell = document.getElementById(`cell-${i}`);
                cell.innerHTML = ''; // 清空
                let occupants = [];
                for (let p = 1; p <= 2; p++) {
                    for (let j = 0; j < 4; j++) {
                        if (pieces[p][j] === i) {
                            const piece = document.createElement('div');
                            piece.className = `piece player${p}`;
                            piece.textContent = colors[p];
                            cell.appendChild(piece);
                            occupants.push(p);
                        }
                    }
                }
                // 甜蜜加成：如果两人棋子重叠
                if (occupants.includes(1) && occupants.includes(2) && i > 0) {
                    sweetBonus = Math.min(sweetBonus + 1, 3);
                    document.getElementById('sweet-bonus').textContent = `甜蜜加成：${sweetBonus}`;
                }
            }
        }

        // 获取随机任务（根据位置和加成渐进）
        function getTask(position) {
            let level = 'low';
            if (position > totalCells * 2 / 3) level = 'high';
            else if (position > totalCells / 3) level = 'medium';
            // 加成影响：高加成升级级别
            if (sweetBonus >= 2 && level === 'low') level = 'medium';
            if (sweetBonus >= 3 && level !== 'high') level = 'high';
            
            const pool = tasks[level];
            const index = Math.floor(Math.random() * pool.length);
            return pool[index];  // 随机抽取
        }

        // 掷骰子
        function rollDice() {
            if (diceValue > 0) return; // 已掷过
            diceValue = Math.floor(Math.random() * 6) + 1 + sweetBonus;
            document.getElementById('dice').textContent = `🎲 ${diceValue}`;
            movePiece();
            console.log('骰子掷出:', diceValue);
        }

        // 移动棋子并触发任务
        function movePiece() {
            // 简化：移动第一个棋子（可扩展为选择）
            let pieceIndex = 0;
            let pos = pieces[currentPlayer][pieceIndex];
            let newPos = pos + diceValue;
            if (newPos > totalCells) newPos = totalCells;
            pieces[currentPlayer][pieceIndex] = newPos;

            // 检查吃子
            for (let j = 0; j < 4; j++) {
                if (pieces[3 - currentPlayer][j] === newPos) {
                    pieces[3 - currentPlayer][j] = 0;  // 退回起点
                }
            }

            // 检查起飞
            if (newPos > 0 && pos === 0) flyingCount[currentPlayer]++;

            // 触发任务
            const taskText = getTask(newPos);
            document.getElementById('task').textContent = `调情任务：${taskText} （执行后继续～）`;

            // 检查胜负
            if (newPos === totalCells) {
                document.getElementById('task').textContent += `\n高潮结局：全力做爱，直到双方高潮喷射！`;
                alert(`${colors[currentPlayer]} 到达终点！游戏结束，进入真实前戏～`);
                resetGame();
                return;
            }
            if (flyingCount[currentPlayer] === 4) {
                alert(`${colors[currentPlayer]} 所有棋子到终点！赢家主导今晚的性爱姿势～`);
                resetGame();
            }

            updateBoard();
            diceValue = 0;
            document.getElementById('dice').textContent = '🎲';
        }

        // 下一个玩家
        function nextPlayer() {
            currentPlayer = 3 - currentPlayer;
            document.getElementById('status').textContent = `当前玩家：玩家${currentPlayer} (${colors[currentPlayer]})`;
            diceValue = 0;
            document.getElementById('dice').textContent = '🎲';
            document.getElementById('task').textContent = '任务区：掷骰子后显示调情任务！';
            console.log('切换玩家:', currentPlayer);
        }

        // 重置游戏
        function resetGame() {
            currentPlayer = 1;
            diceValue = 0;
            pieces = {1: [0,0,0,0], 2: [0,0,0,0]};
            sweetBonus = 0;
            flyingCount = {1: 0, 2: 0};
            document.getElementById('status').textContent = `当前玩家：玩家1 (${colors[1]})`;
            document.getElementById('sweet-bonus').textContent = '甜蜜加成：0';
            document.getElementById('dice').textContent = '🎲';
            document.getElementById('task').textContent = '任务区：掷骰子后显示调情任务！';
            initBoard();
            console.log('游戏重置');
        }

        // 绑定事件（支持触屏）
        const diceElem = document.getElementById('dice');
        diceElem.addEventListener('click', rollDice);
        diceElem.addEventListener('touchstart', function(e) {
            e.preventDefault();
            rollDice();
        });

        const nextPlayerBtn = document.getElementById('nextPlayerBtn');
        nextPlayerBtn.addEventListener('click', nextPlayer);
        nextPlayerBtn.addEventListener('touchstart', function(e) {
            e.preventDefault();
            nextPlayer();
        });

        const resetBtn = document.getElementById('resetBtn');
        resetBtn.addEventListener('click', resetGame);
        resetBtn.addEventListener('touchstart', function(e) {
            e.preventDefault();
            resetGame();
        });
    </script>
</body>
</html>
